import Layout from '../layout/LayoutComp.vue'
import type { RouteRecordRaw } from 'vue-router'

export const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect: '/user', // 重定向页面路由 使得访问/ 就可以进入/home
    children: [
      {
        path: 'user',
        name: 'User',
        component: () => import('../views/UserPage.vue')
      },
      {
        path: '/commoditys',
        name: 'Commoditys',
        component: () => import('../views/CommoditysPage.vue')
      },
      {
        path: '/coupons',
        name: 'Coupons',
        component: () => import('../views/CouponsPage.vue')
      },
      {
        path: '/password',
        name: 'Password',
        component: () => import('../views/PasswordPage.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/LoginPage.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/RegisterPage.vue')
  }
]
